using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;

namespace Renderer.DataStructures
{
    [Serializable]
    class Triangle
    {
        /// <summary>
        /// Cooficient of the transparency i.e. portion of the light with will be passed through the triangle
        /// It will be used when refraction will be calculated
        /// </summary>
        private double transparency;
        
        /// <summary>
        /// Cooficient of the reflection i.e. portion of the light with will be reflected
        /// </summary>
        private double reflection = 0;
        
        /// <summary>
        /// Cooficient of the refraction i.e. ratio between tangents of the angels of the 
        /// refracted and original ray
        /// </summary>
        private double refraction = 0;
        
        /// <summary>
        /// Denote whether this triangle emits light
        /// </summary>
        private bool isLight;
        
        /// <summary>
        /// Color of the triangle
        /// </summary>
        private Color color;
        
        /// <summary>
        /// Coordinates of the triangle
        /// </summary>
        private Vector3D x1,x2,x3;

        public Vector3D X1
        {
            get { return x1; }
            set { x1 = value; }
        }

        public Vector3D X2
        {
            get { return x2; }
            set { x2 = value; }
        }

        public Vector3D X3
        {
            get { return x3; }
            set { x3 = value; }
        }

        public double Transparency
        {
            get { return transparency; }
            set { transparency = value; }
        }

        public double Reflection
        {
            get { return reflection; }
            set { reflection = value; }
        }

        public double Refraction
        {
            get { return refraction; }
            set { refraction = value; }
        }

        public Color Color
        {
            get { return color; }
            set { color = value; }
        }

        public bool IsLight
        {
            get { return isLight; }
            set { isLight = value; }
        }

        public Triangle()
        {
            
        }

        public Triangle(Vector3D x1, Vector3D x2, Vector3D x3)
        {
            this.x1 = x1;
            this.x2 = x2;
            this.x3 = x3;
        }
        
        public override string ToString()
        {
            return x1.ToString() + " " + x2.ToString() + " " + x3.ToString();
        }
    }
}
